﻿using ML.Entity;
using System.Collections.Generic;

namespace ML.IBusiness
{
    /// <summary>
    /// 商户业务接口
    /// </summary>
    public interface IMerchantBusiness
    {
        /// <summary>
        /// 根据查询条件查询商户信息
        /// </summary>
        /// <param name="merchantSearch">商户查询条件</param>
        /// <returns></returns>
        BaseResult<Pager<MerchantResponse>> List(MerchantSearch merchantSearch);

        /// <summary>
        /// 根据商户Id查询商户信息
        /// </summary>
        /// <param name="id">商户Id</param>
        /// <returns></returns>
        BaseResult<MerchantResponse> GetDetailById(string id);

        /// <summary>
        /// 根据商户Id查询商户收款方式
        /// </summary>
        /// <param name="id">商户Id</param>
        /// <returns></returns>
        BaseResult<IEnumerable<ReceivablesEntity>> GetReceivablesByMerchantId(string id);

        /// <summary>
        /// 根据商户Id查询商户活动
        /// </summary>
        /// <param name="id">商户Id</param>
        /// <returns></returns>
        BaseResult<IEnumerable<BusinessActivitiesEntity>> GetBusinessActivitiesByMerchantId(string id);

        /// <summary>
        /// 根据商户Id查询商户产品分类
        /// </summary>
        /// <param name="id">商户Id</param>
        /// <returns></returns>
        BaseResult<IEnumerable<ProductCategoryEntity>> GetProductCategoryByMerchantId(string id);

        /// <summary>
        /// 前端已经在使用此接口—根据平台分类查询营业中未删除商户列表
        /// </summary>
        /// <param name="id">平台分类Id</param>
        /// <param name="pageindex">第几页</param>
        /// <param name="pagesize">每页显示多少条</param>
        /// <returns></returns>
        BaseResult<IEnumerable<MerchantEntity>> GetListByPlatFormId(string id, int pageindex, int pagesize);

        /// <summary>
        /// 前端已经在使用此接口—查询所有营业中未删除的商户列表
        /// </summary>
        /// <param name="name">商户名称</param>
        /// <param name="pageindex">第几页</param>
        /// <param name="pagesize">每页显示多少条</param>
        /// <returns></returns>
        BaseResult<IEnumerable<MerchantEntity>> GetNoDelBusinessList(string name, int pageindex, int pagesize);

        /// <summary>
        /// 查询所有营业中未删除的商户列表并根据排序条件进行排序
        /// </summary>
        /// <param name="name">商户名称</param>
        /// <param name="pageindex">第几页</param>
        /// <param name="pagesize">每页显示多少条</param>
        /// <param name="ratingType">排序条件（0-综合评分、1-速度评分、2-销售量）</param>
        /// <param name="isDesc">是否升序</param>
        /// <returns></returns>
        BaseResult<IEnumerable<MerchantEntity>> GetNoDelBusinessListByRating(string name, int pageindex, int pagesize,
            int ratingType, bool isDesc);

        /// <summary>
        /// 前端已经在使用此接口—根据商户Id获取商户信息
        /// </summary>
        /// <param name="id">商户Id</param>
        /// <returns></returns>
        BaseResult<MerchantEntity> GetInfoById(string id);

        /// <summary>
        /// 根据商户Id获取商户信息（微信小程序）
        /// </summary>
        /// <param name="loginCode">商户Id</param>
        /// <returns></returns>
        BaseResult<MerchantEntity> WXgetInfoByUserId(string loginCode);

        /// <summary>
        ///  前端已经在使用此接口—根据商户Id查询产品分类和产品的组合信息(返回对象)
        /// </summary>
        /// <param name="id">商户Id</param>
        /// <returns></returns>
        BaseResult<IEnumerable<MerchantProductListEntity>> GetProductCategoryAndInfoById(string id);

        /// <summary>
        /// 根据用户Id查询用户下的未删除商户信息
        /// </summary>
        /// <param name="id">用户Id</param>
        /// <returns></returns>
        BaseResult<MerchantEntity> GetNoDelInfoByUserId(string id);

        /// <summary>
        /// 添加商户
        /// </summary>
        /// <param name="merchantEntity">商户实体信息</param>
        /// <returns></returns>
        BaseResult<bool> Add(MerchantEntity merchantEntity);

        /// <summary>
        /// 更新商户信息
        /// </summary>
        /// <param name="merchantEntity">商户实体信息</param>
        /// <returns></returns>
        BaseResult<bool> Update(MerchantEntity merchantEntity);

        /// <summary>
        ///  修改商户营业修改状态
        /// </summary>
        /// <param name="Id">商户Id</param>
        /// <param name="JoinMark">是否营业(0:未营业，1:营业中)</param>
        /// <returns></returns>
        BaseResult<bool> UpdateBusinessState(string Id, string JoinMark);

        /// <summary>
        /// 删除商户
        /// </summary>
        /// <param name="id">主键</param>
        /// <returns></returns>
        BaseResult<bool> Delete(string id);

        /// <summary>
        /// 获取所有商户信息
        /// </summary>
        /// <returns></returns>
        BaseResult<IEnumerable<MerchantEntity>> GetAll();
    }
}